<style type="text/css">
		<!--
		A:link        {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
		A:visited     {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
		A:hover       {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: underline; color: #FF0000}
		th            {font-family: helvetica, arial; color : blue; font-size:85%; background : lightgrey; border-right:black solid 1pt; border-bottom:black solid 1pt;}
		//-->
		</style><hr><a name="_C_CANVASGRAPH"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>CanvasGraph</b> EXTENDS <a href="Graph.html#_C_GRAPH" style="font-face:arial;font-weight:bold;">Graph</a></div>
<i>(Defined in: jpgraph_canvas.php : 22)</i><table border=1><tr><td>&nbsp;<a href="CanvasGraph.html" style="font-family:arial;font-weight:bold;color:darkblue;">CanvasGraph</a>&nbsp;</td><td>&nbsp;<a href="Graph.html" style="font-family:arial;font-weight:bold;color:darkblue;">Graph</a>&nbsp;</td></tr><tr><td valign=top>&nbsp;<a href="CanvasGraph.html#_CANVASGRAPH_CANVASGRAPH">CanvasGraph()</a>&nbsp;<br>
&nbsp;<a href="CanvasGraph.html#_CANVASGRAPH_INITFRAME">InitFrame()</a>&nbsp;<br>
&nbsp;<a href="CanvasGraph.html#_CANVASGRAPH_STROKE">Stroke()</a>&nbsp;<br>
</td><td valign=top>&nbsp;<a href="Graph.html#_GRAPH_ADD">Add()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_ADDBAND">AddBand()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_ADDLINE">AddLine()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_ADDTEXT">AddText()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_ADDY2">AddY2()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_ADJBACKGROUNDIMAGE">AdjBackgroundImage()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_ADJIMAGE">AdjImage()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_CHECKCSIMCACHE">CheckCSIMCache()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_GETHTMLIMAGEMAP">GetHTMLImageMap()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_GRAPH">Graph()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETANGLE">SetAngle()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETAXISSTYLE">SetAxisStyle()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETBACKGROUNDIMAGE">SetBackgroundImage()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETBOX">SetBox()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETCOLOR">SetColor()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETFRAME">SetFrame()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETGRIDDEPTH">SetGridDepth()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETMARGIN">SetMargin()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETMARGINCOLOR">SetMarginColor()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETSCALE">SetScale()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETSHADOW">SetShadow()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETTICKDENSITY">SetTickDensity()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_SETY2SCALE">SetY2Scale()</a>&nbsp;<br>
<a href="Graph.html#_GRAPH_STROKE" style="color:darkgrey;">Stroke()&nbsp;</a><br>
&nbsp;<a href="Graph.html#_GRAPH_STROKECSIM">StrokeCSIM()</a>&nbsp;<br>
&nbsp;<a href="Graph.html#_GRAPH_STROKEFRAMEBACKGROUND">StrokeFrameBackground()</a>&nbsp;<br>
</td></tr></table>&nbsp;<p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>If you for some reason just want plain canvas to draw on using the direct drawing method you can create a new canvas with this class. 
<p>
The canvas is meant to be manipulated through the Image class which can be found as an instance variable ($graph->img) in the canvas class. 
<p>
Please remeber taht using the drawing methods in the Image class assumes screen (pixels) coordinates.
 <p> &nbsp;
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also related classes:</div><a href="Graph.html">Graph</a> <p> &nbsp;<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_CANVASGRAPH_CANVASGRAPH"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
<font color="#0000CC"></font><font color="#006600">function&nbsp;</font><font color="#0000CC">CanvasGraph</font><font color="#006600">(</font><font color="#0000CC">$aWidth</font><font color="#006600">,</font><font color="#0000CC">$aHeight</font><font color="#006600">,</font><font color="#0000CC">$aCachedName</font><font color="#006600">,</font><font color="#0000CC">$timeout</font><font color="#006600">,</font><font color="#0000CC">$inline</font><font color="#006600">)</font><font color="#0000CC"></font>
</font>
</b></div></a></span>

<span style='font-family:arial;font-size:90%;'><i>Construct a new Cnavas graph</i></span><p>

<table cellspacing=0 style='border:black solid 1pt;' width=100%>
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC">$aWidth</font>
</font>
</code>
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC">300</font>
</font>
</code></td><td>Width of graph</td></tr>

<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC">$aHeight</font>
</font>
</code>
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC">200</font>
</font>
</code></td><td>Height of graph</td></tr>

<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC">$aCachedName</font>
</font>
</code>
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC"></font><font color="#CC0000">""</font><font color="#0000CC"></font>
</font>
</code></td><td>Cache file name</td></tr>

<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC">$timeout</font>
</font>
</code>
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC">0</font>
</font>
</code></td><td>Cache timeout</td></tr>

<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC">$inline</font>
</font>
</code>
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC">1</font>
</font>
</code></td><td>Inline or not</td></tr>
</table>

<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>See Graph::Graph() for description, this method is identical.&nbsp;<br>
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Graph.html#_GRAPH_GRAPH">Graph::Graph</a>
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
<font color="#0000CC"></font><font color="#FF9900">// Create a new canvas and draw a line from top left to<br />// bottom right<br /></font><font color="#0000CC">$canvas&nbsp;</font><font color="#006600">=&nbsp;new&nbsp;</font><font color="#0000CC">CanvasGraph</font><font color="#006600">(</font><font color="#0000CC">300</font><font color="#006600">,</font><font color="#0000CC">200</font><font color="#006600">);<br /></font><font color="#0000CC">$canvas</font><font color="#006600">-&gt;</font><font color="#0000CC">img</font><font color="#006600">-&gt;</font><font color="#0000CC">SetColor</font><font color="#006600">('</font><font color="#0000CC">black*);<br />$canvas-&gt;img-&gt;Line(0,0,300,200);<br />$canvas-&gt;Stroke();</font>
</font>
</span><br>
<p>
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_CANVASGRAPH_INITFRAME"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
<font color="#0000CC"></font><font color="#006600">function&nbsp;</font><font color="#0000CC">InitFrame</font><font color="#006600">()</font><font color="#0000CC"></font>
</font>
</b></div></a></span>

<span style='font-family:arial;font-size:90%;'><i>Strokes plot area and margin</i></span><p>
<br>

<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Calling this method will fill the margin (with the margin color) and fill the plot area with the plot color. You should call this method before stroking anything else to the canvas as otherwise what you have stroken will be overwritten.&nbsp;<br>

<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
<font color="#0000CC"></font><font color="#FF9900">// Setup a basic canvas we can work <br /></font><font color="#0000CC">$g&nbsp;</font><font color="#006600">=&nbsp;new&nbsp;</font><font color="#0000CC">CanvasGraph</font><font color="#006600">(</font><font color="#0000CC">400</font><font color="#006600">,</font><font color="#0000CC">200</font><font color="#006600">,</font><font color="#CC0000">'auto'</font><font color="#006600">);<br /></font><font color="#0000CC">$g</font><font color="#006600">-&gt;</font><font color="#0000CC">SetMargin</font><font color="#006600">(</font><font color="#0000CC">5</font><font color="#006600">,</font><font color="#0000CC">11</font><font color="#006600">,</font><font color="#0000CC">6</font><font color="#006600">,</font><font color="#0000CC">11</font><font color="#006600">);<br /></font><font color="#0000CC">$g</font><font color="#006600">-&gt;</font><font color="#0000CC">SetShadow</font><font color="#006600">();<br /></font><font color="#0000CC">$g</font><font color="#006600">-&gt;</font><font color="#0000CC">SetMarginColor</font><font color="#006600">(</font><font color="#CC0000">"teal"</font><font color="#006600">);<br /><br /></font><font color="#FF9900">// We need to stroke the plotarea and margin before we add the<br />// text since we otherwise would overwrite the text.<br /></font><font color="#0000CC">$g</font><font color="#006600">-&gt;</font><font color="#0000CC">InitFrame</font><font color="#006600">();<br /><br /></font><font color="#FF9900">// Draw a text box in the middle<br /></font><font color="#0000CC">$txt</font><font color="#006600">=</font><font color="#CC0000">"This\nis\na TEXT!!!"</font><font color="#006600">;<br /></font><font color="#0000CC">$t&nbsp;</font><font color="#006600">=&nbsp;new&nbsp;</font><font color="#0000CC">Text</font><font color="#006600">(</font><font color="#0000CC">$txt</font><font color="#006600">,</font><font color="#0000CC">200</font><font color="#006600">,</font><font color="#0000CC">10</font><font color="#006600">);<br /></font><font color="#0000CC">$t</font><font color="#006600">-&gt;</font><font color="#0000CC">SetFont</font><font color="#006600">(</font><font color="#0000CC">FF_ARIAL</font><font color="#006600">,</font><font color="#0000CC">FS_BOLD</font><font color="#006600">,</font><font color="#0000CC">40</font><font color="#006600">);<br /><br /></font><font color="#FF9900">// Stroke the text<br /></font><font color="#0000CC">$t</font><font color="#006600">-&gt;</font><font color="#0000CC">Stroke</font><font color="#006600">(</font><font color="#0000CC">$g</font><font color="#006600">-&gt;</font><font color="#0000CC">img</font><font color="#006600">);<br /><br /></font><font color="#FF9900">// Stroke the graph<br /></font><font color="#0000CC">$g</font><font color="#006600">-&gt;</font><font color="#0000CC">Stroke</font><font color="#006600">();<br /></font><font color="#0000CC"></font>
</font>
</span><br>
<p>
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_CANVASGRAPH_STROKE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
<font color="#0000CC"></font><font color="#006600">function&nbsp;</font><font color="#0000CC">Stroke</font><font color="#006600">(</font><font color="#0000CC">$aStrokeFileName</font><font color="#006600">)</font><font color="#0000CC"></font>
</font>
</b></div></a></span>

<span style='font-family:arial;font-size:90%;'><i>Stroke graph to browser or file</i></span><p>

<table cellspacing=0 style='border:black solid 1pt;' width=100%>
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC">$aStrokeFileName</font>
</font>
</code>
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><code><font color="#000000">
<font color="#0000CC"></font><font color="#CC0000">""</font><font color="#0000CC"></font>
</font>
</code></td><td>Filename to stroke to</td></tr>
</table>

<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Stroke a file to browser or file. See Graph::Stroke() for more details.&nbsp;<br>
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Graph.html#_GRAPH_STROKE">Graph::Stroke</a>
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
<font color="#0000CC">$canvas</font><font color="#006600">-&gt;</font><font color="#0000CC">Stroke</font><font color="#006600">();</font><font color="#0000CC"></font>
</font>
</span><br>
<p> <hr> <p>